import request from '@/utils/request'

// 查询预警报警记录
export function queryAllByPage(query) {
  return request({
    url: '/alarm/queryAllByPage',
    method: 'get',
    params: query
  })
}

// 查询预警报警-统计报表-total为次数
export function queryAllCountReport(query) {
  return request({
    url: '/alarm/queryAllCountReport',
    method: 'get',
    params: query
  })
}

// 导出预警报警记录到excel文件
export function exportExcel(query) {
  let url = process.env.VUE_APP_BASE_API + '/alarm/exportExcel?'
  const param = []
  for (const key in query) {
    param.push(key + '=' + query[key])
  }
  url += param.join('&')

  console.log(url)
  window.open(url, 'Download')
}
